<?php
include_once("../includes/seat.class.php");
include_once("../includes/global.php");
include_once("../includes/smarty_config.php");
if(empty($buid)){
    echo json_encode(['status' => false, 'url' => $config['weburl'].'/login.php' ]);
    return false;
}
function getData($method){
    $head = seat::getHeader($method);
    $body = [
        'orgid' => '83',
        'loginid' => '3503',
        'loginname' => '',
        'contactname' => '',
        'contactphone' => '',
        'contactemail' => '',
        'contactzipcode' => '',
        'contactaddress' => '',

    ];
    $postData = array (
        'head' => $head,
        'body' => $body
    );
    $hidformdata = seat::requestFormat($postData);
    return $hidformdata;
}

$postData = $_POST;

if(!empty($postData['product_id'])){
    $_SESSION['product_info'] = serialize($postData);
} else {
    if(empty($postData['seat_id']) || empty($postData['product_id'])){
        echo json_encode(['status' => false,'msg' => '提交数据异常' ]);
        return false;
    }
}

$formData['hidformdata'] = getData('login');
$formData['hidorgid'] = '83';
$formData['hidaccount'] = seat::ACCOUNT;
$formData['hidredirecturl'] = "http://mseat.0368.com/local/83_30/areas.html?pid=".$postData['seat_id'];
$formUrl= "http://mseat.0368.com/login.aspx";
$buildForm = seat::buildForm($formUrl,$formData,"确认");
echo json_encode(['status' => true, 'content' => $buildForm ]);
return false;


?>